(defun iterate-over-antibody-registry-rows (fn &optional (limit nil) (file *antibody-registry-excel-source*))
  (let ((the-sheet 
	  (get-sheets :file *registry-excel-source* :only-sheets '("Human Markers")
			  :skip-rows 3 ; skip to the coding-friendly headers
			  :row-limit limit ; testing
			  :with-style? t ; we want the cell backgrounds
			  :process-hyperlink? t ; we need the links
			  )))
    (loop for row  in the-sheet for rownum from 5 do (funcall fn row rownum))))


(defun write-antibody-registry-owl-from-spreadsheet (file *antibody-registry-excel-source*)
  (let ((the-sheet 
	 (car (get-sheets :file *registry-excel-source* :only-sheets '("Human Markers")
			  :skip-rows 3 ; skip to the coding-friendly headers
			  :row-limit 10 ; testing
			  :with-style? t ; we want the cell backgrounds
			  :process-hyperlink? t ; we need the links
			  ))))
    (with-ontology antio (:collecting t :ontology-iri !<http://purl.obolibrary.org/obo/antio.owl>)
	(loop for row in the-sheet
	     do 
	     (as (translate-one-antibody-registry-row row))))))

(defun maybe-link-label (el)
  (if (and (consp el) (eq (car el) :link))
      (third el)
      el))

(defun maybe-unstyled (el)
  (if (and (consp el) (eq (car el) :with-style))
      (values (second el) (cddr el))
      el))
  
(defun report-questionable-rows ()
  (iterate-over-antibody-registry-rows 
   (lambda(row rownum)
     (let ((pro-id (maybe-link-label (maybe-unstyled (second (assoc :pro-id row)))))
	   (clone-name (maybe-unstyled (second (assoc :clone row))))
	   (marker-name (maybe-unstyled (second (assoc :marker row)))))
       (and pro-id (setq pro-id (substitute #\_ #\: pro-id :test 'char=)))
       (unless (and pro-id clone-name marker-name)
	 (format t "Row ~4,' d, ~a, ~a, ~a~%"
		 rownum
		 (or (and marker-name (format nil "marker name: ~a" marker-name)) "no marker name")
		 (or (and pro-id (format nil "pro id: ~a" pro-id)) "no pro id")
		 (or (and clone-name (format nil "clone: ~a" clone-name)) "no clone name")
		 )
	 )))))

(defparameter antibody-spreadsheet-columns 
  '(bdplate ; "X" if not on bd plate, otherwise plate number
    oboid-num ; localname will be ANTIO_<oboid-num> (padded with leading 0s)
    marker
    alt-label
    gene-link
    gene-symbol
    gene-name
    uniprot-link
    protein-name
    pro-id
    pro-name
    clone
    species
    isotype
    nif-link
    bd-catalog-no
    ebio-catalog-no
    acris-catalog-no
    biolegend-catalog-no
    abcam-catalog-no
    invitrogen-catalog-no
    rand-catalog-no
    novus-catalog-no
    genway-catalog-no
    meridian-catalog-no
    abdserotec-catalog-no
    fisher-catalog-no
    millipore-catalog-no
    cst-catalog-no
    dvs-catalog-no
    militeny-catalog-no
    note0
    note1
    note2
    pubmed1
    pubmed2
    pubmed3))

immport antibody registry ontology

AITI

    bd-catalog-no
    ebio-catalog-no
    acris-catalog-no
    biolegend-catalog-no
    abcam-catalog-no
    invitrogen-catalog-no http://isni-url.oclc.nl/isni/0000000088830121
    rand-catalog-no
    novus-catalog-no
    genway-catalog-no
    meridian-catalog-no
    abdserotec-catalog-no http://www.linkedin.com/company/abd-serotec
    fisher-catalog-no
    millipore-catalog-no
    cst-catalog-no
    dvs-catalog-no
    militeny-catalog-no







		
antibodies useful for immunology

abri
